//
//  WSMineFooterView.m
//  LANGirl
//
//  Created by 吴帅 on 16/3/28.
//
//

#import "WSMineFooterView.h"
#import "VippViewController.h"

@implementation WSMineFooterView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = LV;
        [self creatSubView];
    }
    return self;
}

- (void)creatSubView {
    
    //模板的图片
    UIImageView * banImage = [[UIImageView alloc]init];
    banImage.image = [UIImage imageNamed:@"muban@3p"];
    [self addSubview:banImage];
    [banImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self).offset(100 * AUTO_HEIGHT);
        make.right.equalTo(self.mas_right).offset(-30.00/2*AUTO_WIDTH);
        make.left.equalTo(self).offset(30.00/2*AUTO_WIDTH);
        
    }];
    
    //每日签到图片//主页推广
    _singImage = [[UIImageView alloc]init];
    _singImage.image = [UIImage imageNamed:@"每日签到@2p"];
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(selectAction:)];
    [_singImage addGestureRecognizer:tap];
    _singImage.tag = 1200;
    _singImage.userInteractionEnabled=YES;
    [self addSubview:_singImage];
    [_singImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(27.00 * AUTO_WIDTH);
        make.left.mas_equalTo(40.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(70.00 * AUTO_WIDTH, 100.00 * AUTO_WIDTH));
    }];
    
    
    //每日签到
    _qiandaoLabel = [[UILabel alloc]init];
    _qiandaoLabel.alpha = 0.5;
    _qiandaoLabel.text = @"每日签到";
    _qiandaoLabel.textAlignment = NSTextAlignmentCenter;
    _qiandaoLabel.font=[UIFont systemFontOfSize:15.00*AUTO_WIDTH];
    
    [self addSubview:_qiandaoLabel];
    [_qiandaoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_singImage.mas_bottom).offset(-10 * AUTO_HEIGHT);
        make.left.mas_equalTo(40.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(70*AUTO_WIDTH, 100.00*AUTO_WIDTH));
        
    }];
    
    
    //每日速配图片
    _pairImage = [[UIImageView alloc]init];
    _pairImage.image = [UIImage imageNamed:@"每日速配@2p"];
    tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(selectAction:)];
    [_pairImage addGestureRecognizer:tap];
    _pairImage.userInteractionEnabled = YES;
    _pairImage.tag = 1201;
    [self addSubview:_pairImage];
    [_pairImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_singImage);
        make.left.equalTo(_singImage.mas_right).offset(40.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(70*AUTO_WIDTH, 100.00*AUTO_WIDTH));
        
    }];
    
    
    //每日速配
    _supeiLabel = [[UILabel alloc]init];
    _supeiLabel.userInteractionEnabled = YES;
    _supeiLabel.alpha = 0.5;
    _supeiLabel.text = @"每日速配";
    _supeiLabel.font=[UIFont systemFontOfSize:15.00*AUTO_WIDTH];
    _supeiLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:_supeiLabel];
    [_supeiLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_pairImage.mas_bottom).offset(-10 * AUTO_HEIGHT);
        make.left.equalTo(_singImage.mas_right).offset(27.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(95.00*AUTO_WIDTH, 100.00*AUTO_WIDTH));
        
    }];
    
    
    //认证身份图片
    _vipImage = [[UIImageView alloc]init];
    _vipImage.image = [UIImage imageNamed:@"认证身份@2p"];
    _vipImage.userInteractionEnabled = YES;
    _vipImage.tag = 1202;
    
    tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(selectAction:)];
    [_vipImage addGestureRecognizer:tap];
    [self addSubview:_vipImage];
    [_vipImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_singImage);
        make.right.equalTo(self.mas_right).offset(-40.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(70*AUTO_WIDTH, 100.00*AUTO_WIDTH));
        
    }];
    
    
    //身份认证
    _renzhnegLabel = [[UILabel alloc]init];
    _renzhnegLabel.alpha = 0.5;
    _renzhnegLabel.text = @"身份认证";
    _renzhnegLabel.textAlignment = NSTextAlignmentCenter;
    _renzhnegLabel.font=[UIFont systemFontOfSize:15.00*AUTO_WIDTH];
    [self addSubview:_renzhnegLabel];
    [_renzhnegLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_vipImage.mas_bottom).offset(-10 * AUTO_HEIGHT);
        make.right.equalTo(self.mas_right).offset(-28.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(95.00*AUTO_WIDTH, 100.00*AUTO_WIDTH));
    }];
    
}

- (void)setSingImage:(UIImageView *)singImage{
    _singImage = singImage;
}
- (void)setQiandaoLabel:(UILabel *)qiandaoLabel{
    _qiandaoLabel = qiandaoLabel;
}
- (void)setPairImage:(UIImageView *)pairImage{
    _pairImage = pairImage;
}
- (void)setVipImage:(UIImageView *)vipImage{
    _vipImage = vipImage;
}
- (void)setRenzhnegLabel:(UILabel *)renzhnegLabel{
    _renzhnegLabel = renzhnegLabel;
}
- (void)setSupeiLabel:(UILabel *)supeiLabel{
    _supeiLabel = supeiLabel;
}
- (void)selectAction:(UITapGestureRecognizer *)tap {

    [self.delegate footerPushViewController:tap.view.tag];
//    VippViewController *vipp=[[VippViewController alloc]init];
//     [self.navigationController pushViewController:vipp animated:YES];
   
    
}






@end
